package com.zbkj.common.request.project;

import com.zbkj.common.request.standard.AddProjectStandardRequest;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Range;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Auther:
 * @Date: 2024/7/6 14:09
 * @Description:
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "ClientProjectRequest对象", description = "客户端项目维护请求对象")
public class ClientProjectRequest implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("项目ID-重新提交使用")
    @NotNull(groups = {ResubmitProjectGroup.class}, message = "项目ID不能为空")
    private Long id;

    @ApiModelProperty("项目名称")
    @NotBlank(groups = {CreateProjectGroup.class,ResubmitProjectGroup.class}, message = "项目名称不能为空")
    private String projectName;

    @ApiModelProperty("项目类型：1 国标项目，2 军标项目")
    @NotNull(groups = {CreateProjectGroup.class,ResubmitProjectGroup.class}, message = "请选择项目类型")
    @Range(groups = {CreateProjectGroup.class,ResubmitProjectGroup.class},min = 1, max=2, message = "项目类型参数错误")
    private Integer projectType;

    @ApiModelProperty("评估标准：国标项目时1 ，军标项目时2")
    @NotNull(groups = {CreateProjectGroup.class,ResubmitProjectGroup.class}, message = "请选择评估标准")
    private Integer criteriaType;

    @ApiModelProperty("重用程度 军标重用程度选项 国标为0")
    private Integer reuseItem;

    @ApiModelProperty("项目联系人")
    @NotBlank(groups = {CreateProjectGroup.class,ResubmitProjectGroup.class}, message = "项目联系人不能为空")
    private String contactName;
    @ApiModelProperty("项目联系电话")
    @NotBlank(groups = {CreateProjectGroup.class,ResubmitProjectGroup.class}, message = "项目联系电话不能为空")
    private String contactPhone;

    @ApiModelProperty("项目预算金额")
    private BigDecimal budgetAmount;

    @ApiModelProperty("省份code")
    private String provinceCode;
    @ApiModelProperty("省份名称")
    private String provinceName;
    @ApiModelProperty("市code")
    private String cityCode;
    @ApiModelProperty("市名称")
    private String cityName;

    @ApiModelProperty("国标调整因子对象")
    private ProjectParamGuoRequest paramGuoRequest;

    @ApiModelProperty("军标调整因子对象")
    private ProjectParamJunRequest paramJunRequest;

    @ApiModelProperty("项目上传资料集合")
    @NotEmpty(groups = {CreateProjectGroup.class,ResubmitProjectGroup.class}, message = "请上传项目资料")
    @Valid
    List<ClientInformationRequest> informationRequestList;

    private Long standardId;

    public interface CreateProjectGroup {};

    public interface ResubmitProjectGroup{}

    private List<AddProjectStandardRequest> addProjectStandardRequestList;
}
